//
//  XQOrderTimeCell.swift
//  Spark Peso
//
//  Created by 小琦 on 2025/2/4.
//

import UIKit

class XQOrderTimeCell: UITableViewCell {
    
    var model : XQOrderSteadyModel? {
        didSet {
            self.prefixLb.text = model?.accessing ?? ""
            self.suffixLb.text = model?.reduce ?? ""
        }
    }
    
    private lazy var prefixLb : UILabel = {
       let lb = UILabel()
        lb.textColor = UIColor(hex: "#A3A6A9")
        lb.font = UIFont.systemFont(ofSize: 12)
        return lb
    }()
    
    private lazy var suffixLb : UILabel = {
        let lb = UILabel()
        lb.textColor = .xq_black
        lb.font = UIFont.systemFont(ofSize: 12,weight: .medium)
        return lb
    }()

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
       super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        makeUI()
        makeConstraints()
    }

    required init?(coder: NSCoder) {
       fatalError("init(coder:) has not been implemented")
    }
    
    private func makeUI() {
        self.contentView.addSubview(self.prefixLb)
        self.contentView.addSubview(self.suffixLb)
    }
    
    private func makeConstraints() {
        self.prefixLb.snp.makeConstraints { make in
            make.top.equalTo(0)
            make.left.equalTo(10)
            make.bottom.equalTo(-10)
        }
        self.suffixLb.snp.makeConstraints { make in
            make.centerY.equalTo(self.prefixLb)
            make.right.equalTo(-10)
        }
    }
}
